package com.hs.srm.base.constants;

import sunnykid.util.EnumHelper;
import sunnykid.util.EnumUtils;

public enum StatusType implements EnumHelper<Integer> {

	NORMAL(0x0, Integer.valueOf(1), "启用", null), FORBIDDEN(0x1, Integer.valueOf(0), "禁用", null);

	int index;
	Integer code;
	String text;
	String description;

	StatusType(int index, Integer code, String text, String description) {
		this.index = index;
		this.code = code;
		this.text = text;
		this.description = null;
	}

	/**
	 * 返回
	 * 
	 * @return the index int
	 */
	public int getIndex() {
		return this.index;
	}

	@Override
	public Integer getCode() {
		return this.code;
	}

	@Override
	public String getText() {
		return this.text;
	}

	@Override
	public String getDescription() {
		return this.description;
	}

	@Override
	public EnumHelper<Integer> getByCode(Integer code) {
		return EnumUtils.getByCode(this, code);
	}

	@Override
	public EnumHelper<Integer> getByCodeStr(String codeStr) {
		return EnumUtils.getByCodeStr(this, codeStr);
	}

	@Override
	public EnumHelper<Integer> getByText(String text) {
		return EnumUtils.getByText(this, text);
	}

	@Override
	public EnumHelper<Integer>[] items() {
		return StatusType.values();
	}

	@Override
	public EnumHelper<Integer> get(int index) {
		return EnumUtils.get(this, index);
	}

	@Override
	public int index() {
		return this.index;
	}

}
